/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.affero.action;

import java.util.Locale;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

public class LocaleAction extends DispatchAction {
    
    public ActionForward idiomaEnglish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession();
        session.setAttribute("org.apache.struts.action.LOCALE", new Locale("en", "US"));
        return mapping.findForward("success");
    }
    
    public ActionForward idiomaPortugues(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession();
        session.setAttribute("org.apache.struts.action.LOCALE", new Locale("pt", "BR"));
        return mapping.findForward("success");
    }
    
}
